Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 6 - Printing Resources / Printing Resources Reference
Resources Used Only in Printer Drivers


The Customization ('cust') Resource

The driver customization ('cust') resource, of type gxCustType, tells QuickDraw GX how to support the use of your printer driver by Macintosh Printing Manager applications. It defines values that help QuickDraw GX to translate Macintosh Printing Manager calls into messages for your printer driver. If you do not include a customization resource for your driver, a default version is used by QuickDraw GX. The default version works well for most drivers. Figure 6-16 shows the structure of a customization resource.

Figure 6-16 The customization resource

The customization resource defines the following:

Table 6-20 shows the constants that you can use to specify the updriver type in customization resources.
Table 6-20 Updriver values for the customization resource
ConstantValueExplanation
defaultUpDriver0LaserWriter interface
laserWriter0LaserWriter interface
laserWriterSC1LaserWriter SC interface

Table 6-21 shows the constants that you can use to specify translator settings in customization resources.
Table 6-21 Translator setting values
ConstantValueExplanation
gxDefaultOptionsTranslation0x0000These default settings produce the most accurate representation of the QuickDraw data.
gxOptimizedTranslation0x0001The translator fills in the center of outline text shapes that are drawn in srcOr mode with white, producing the same effect as black-and-white QuickDraw.
gxReplaceLineWidthTranslation0x0002The line width specified in the PostScript SetLineWidth command becomes the new line width. The default (without this option) is to scale the line width by the specified value.
gxSimpleScalingTranslation0x0004The translator scales data via a simple multiply, without compensating for increased resolution. The resulting scaled image is similar to what QuickDraw would have produced when it scaled the data.
gxSimpleGeometryTranslation0x0008The translator translates QuickDraw data without taking into account the QuickDraw hanging pen. The translator does not reproduce the QuickDraw 6-sided line and 7-sided triangle. This means faster drawing with QuickDraw GX with some loss of accuracy.

This option turns on the gxSimpleScalingTranslation option.

gxSimpleLinesTranslation0x000CThe translator maintains the width of lines when lines are at an angle, rather than producing a thicker diagonal line. With this option, line width is the same as pen width.

This option turns on the simpleScalingTranslation and simpleGeometryTranslation options.

gxLayoutTextTranslation0x0010The translator allows layout to perform default substitutions, which produce text that is more attractive than, but different from, the original QuickDraw text.
gxRasterTargetTranslation0x0020The translator produces output for a raster device.
gxPostScriptTargetTranslation0x0040The translator produces output for a PostScript device.

The customization resource ID needs to be the constant gxCustID (-8192). Listing 6-14 shows an example of a customization resource for the ImageWriter II printer driver, which uses the optimized translation settings and scales bitmaps by a factor of 2 both horizontally and vertically.

Listing 6-14 An example of a customization resource

resource gxCustType (gxCustID, sysHeap, purgeable)
{
   144, 144,      /* 144 dpi device */
   defaultUpDriver,     /* use default upDriver */
   {2,2},               /* pattern scaling (144dpi/72dpi)*/
   gxOptimizedTranslation/* use optimized translator settings */
};

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help